$OpenBSD: patch-apps_haartraining_CMakeLists_txt,v 1.3 2015/01/24 10:56:43 zhuk Exp $
Fix linking.
--- apps/haartraining/CMakeLists.txt.orig	Wed Oct  1 09:33:36 2014
+++ apps/haartraining/CMakeLists.txt	Sun Dec 21 20:16:55 2014
@@ -14,8 +14,6 @@ if(WIN32)
   link_directories(${CMAKE_CURRENT_BINARY_DIR})
 endif()
 
-link_libraries(${OPENCV_HAARTRAINING_DEPS} opencv_haartraining_engine)
-
 # -----------------------------------------------------------
 #  Library
 # -----------------------------------------------------------
@@ -42,6 +40,8 @@ set_target_properties(opencv_haartraining_engine PROPE
                       INSTALL_NAME_DIR lib
                      )
 
+target_link_libraries(opencv_haartraining_engine ${OPENCV_HAARTRAINING_DEPS})
+
 # -----------------------------------------------------------
 #  haartraining
 # -----------------------------------------------------------
@@ -50,6 +50,7 @@ add_executable(opencv_haartraining cvhaartraining.h ha
 set_target_properties(opencv_haartraining PROPERTIES
                       DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
                       OUTPUT_NAME "opencv_haartraining")
+target_link_libraries(opencv_haartraining opencv_haartraining_engine)
 
 # -----------------------------------------------------------
 #  createsamples
@@ -59,6 +60,7 @@ add_executable(opencv_createsamples cvhaartraining.h c
 set_target_properties(opencv_createsamples PROPERTIES
                       DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
                       OUTPUT_NAME "opencv_createsamples")
+target_link_libraries(opencv_createsamples opencv_haartraining_engine)
 
 # -----------------------------------------------------------
 #  performance
@@ -67,6 +69,7 @@ add_executable(opencv_performance performance.cpp)
 set_target_properties(opencv_performance PROPERTIES
                       DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}"
                       OUTPUT_NAME "opencv_performance")
+target_link_libraries(opencv_performance opencv_haartraining_engine)
 
 # -----------------------------------------------------------
 #  Install part
